import request from '@/utils/request'
export default {
    // 添加课程信息
    addCourseInfo(courseInfo) {
        return request({
            url: '/course/addCourseInfo',
            method: 'post',
            data: courseInfo
        })
    },
    // 查询所有讲师
    getTeacherList() {
        return request({
            url: '/teacher/findAll',
            method: 'get'
        })
    },
    // 根据课程id查询课程基本信息
    getCourseInfoById(courseId) {
        return request({
            url: '/course/getCourseInfo/' + courseId,
            method: 'get'
        })
    },
    // 修改课程信息
    updateCourseInfo(courseInfo) {
        return request({
            url: '/course/updateCourseInfo',
            method: 'post',
            data: courseInfo
        })
    },
    //根据课程id查询课程确认信息
    getPublishCourseInfo(courseId) {
        return request({
            url: '/course/getPublishCourseInfo/' + courseId,
            method: 'get'
        })
    },
    //课程最终发布
    publishCourse(courseId) {
        return request({
            url: '/course/publishCourse/' + courseId,
            method: 'post'
        })
    },
    //获取课程列表
    getCourseList() {
        return request({
            url: '/course/getCourseList',
            method: 'get'
        })
    },
    // TODO 完善条件查询带分页
    getPageList(current, limit, courseQuery) {
        return request({
            url: `/course/pageCourse/${current}/${limit}`,
            method: 'post',
            data: courseQuery
        })
    },
    removeById(id) {
        return request({
            url: `/course/remove/${id}`,
            method: 'delete'
        })
    }
}